/*
 * ReturnExpressionAst.cpp
 *
 *  Created on: 8 Nov 2010
 *      Author: kn308
 */

#include "ReturnExpressionAst.h"
#include "../Codegen.h"

namespace MAlice
{

ReturnExpressionAst::ReturnExpressionAst(ExpressionAst* expression) :
	mExpression(expression)
{
}

ReturnExpressionAst::~ReturnExpressionAst()
{
}

llvm::Value* ReturnExpressionAst::generate()
{
	return Codegen::get()
			->getBuilder()
			->CreateRet(getExpression()->generate());
}

}
